﻿using System;

namespace Com.Lancetinc.Evs.Communications
{
    /// <summary>
    /// 通信异常
    /// </summary>
    public class CommException : Exception
    {
        /// <summary>
        /// 构造通信异常对象
        /// </summary>
        /// <param name="message"></param>
        public CommException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 超时异常
    /// </summary>
    public class CommTimeoutException : CommException
    {
        public CommTimeoutException()
            : base("Timeout")
        {
        }
    }

    /// <summary>
    /// 无效数据异常
    /// </summary>
    public class CommInvalidDataException : CommException
    {
        public CommInvalidDataException(string message)
            : base(message)
        {
        }

        public CommInvalidDataException()
            : base("Invalid data")
        {
        }
    }

    public class CommNakException : CommException
    {
        public CommNakException()
            : base("NAK")
        {
        }
    }
}
